package proxy;

/**
 * @author 761472239
 * @Classname DProxy
 * @Description TODO
 * @Date 2021/9/1 23:28
 */
public class Proxy extends Subject{
    private RealSubject realSubject;
    @Override
    void Request() {
        if (realSubject == null) {
            realSubject = new RealSubject();
        }
        before();
        realSubject.Request();
        after();
    }

    private void after() {
        System.out.println("访问真实主题之后的后续处理。");
    }

    private void before() {
        System.out.println("访问真实主题之前的预处理。");
    }
}
